import { Navigate } from 'react-router-dom'
import React from 'react'
import Demo from '@/views/demo'

const Home =  React.lazy(() => import('@/views/home'))
const Entire = React.lazy(() => import('@/views/entire'))
const Detail = React.lazy(() => import('@/views/detail'))

const routes = [
  {
    path: '/',
    // 配置重定向
    element:<Navigate to='/home'/>
  },
  {
    path: '/home',
    element: <Home/>,
    // 二级路径
    children: [
      {path:'/home',element:<Navigate to='/home/recomms'/>},
      // {path:'/home/recomms',element:<Recomms/>},
    ]
  },
  {
    path: '/entire',
    element: <Entire/>
  },
  {
    path: '/detail',
    element: <Detail/>
  },
  {
    path: '/demo',
    element: <Demo/>
  },
]

export default routes